package vip.xiaonuo.client.modular.question.enums;

import lombok.Getter;

/**
 * 题目类型
 */
@Getter
public enum QuestionTypeEnum {
    JUDGE("judge", "判断题"),
    ONE("one", "单选题"),
    MULTI("multi", "多选题"),
    FILL("fill", "填空题"),
    SIMPLE("simple", "简答题");
    private final String value;

    private final String desc;

    QuestionTypeEnum(String value, String desc) {
        this.value = value;
        this.desc = desc;
    }

    public static QuestionTypeEnum getByValue(String value) {
        for (QuestionTypeEnum item : QuestionTypeEnum.values()) {
            if (item.getValue().equals(value)) {
                return item;
            }
        }
        return null;
    }
}
